<!--
 * @Description: 
 * @Autor: 商晓彬
 * @Date: 2021-08-20 09:56:50
 * @LastEditors: 商晓彬
 * @LastEditTime: 2021-09-14 09:18:19
-->
<div bsModal #createOrEditModal="bs-modal" class="modal fade add " tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static', keyboard: !saving}">
    <div style="width:1200px!important;margin: 1.75rem auto;">
        <div class="modal-content">
            <form *ngIf="active" #drawForm="ngForm" novalidate autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>制造BOM同步</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="row align-items-center m--margin-bottom-10">
                        <div class="col-xl-12">
                            <div class="form-group m-form__group align-items-center">
                                <div class="input-group">
                                    <h4>选择总装BOP任务清单</h4>
                                    <span class="input-lable ml"
                                        style="margin-top:7px;margin-right: 20px;margin-left: 20px;">型号：</span>
                                    <input style="line-height: 24px!important;width: 150px;" name="model" id="model"
                                        type="text" size="30" pInputText [(ngModel)]="model">
                                    <span class="input-lable"
                                        style="margin-top:7px;margin-right: 20px;margin-left: 20px;">发次：</span>
                                    <input style="line-height: 24px!important;width: 150px;" name="sendTime"
                                        id="sendTime" type="text" size="30" pInputText [(ngModel)]="sendTime">
                                    <span class="input-lable"
                                        style="margin-top:7px;margin-right: 20px;margin-left: 20px;">图号：</span>
                                    <input style="line-height: 24px!important;width: 150px;" name="lotNo" id="lotNo"
                                        type="text" size="30" pInputText [(ngModel)]="lotNo">
                                    <p-button label="查询" (onClick)="getTableList()" class="ml"></p-button>
                                    <p-button label="重置" (onClick)="reset()" class="ml"></p-button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                        <p-table #dataTable (onLazyLoad)="getTableList($event)" [value]="primengTableHelper.records"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false"
                            [(selection)]="selectedCar" [lazy]="true" dataKey="id" [scrollable]="true"
                            ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns">
                            <ng-template pTemplate="header">
                                <tr>
                                    <th style="width: 100px">
                                        选择
                                    </th>
                                    <th style="width: 150px">
                                        型号
                                    </th>
                                    <th style="width: 150px">
                                        发次
                                    </th>
                                    <th style="width: 150px">
                                        名称
                                    </th>
                                    <th style="width: 150px">
                                        图号
                                    </th>
                                    <th style="width: 150px">
                                        创建人
                                    </th>
                                    <th style="width: 150px">
                                        创建日期
                                    </th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit">
                                <tr>
                                    <td style="width: 100px">

                                        <p-tableRadioButton [value]="record"></p-tableRadioButton>

                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.model}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"></span>
                                        {{record.lotNo}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.modelName}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.drawingNo}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.createUserName}}
                                    </td>
                                    <td style="width: 150px">
                                        <span class="ui-column-title"> </span>
                                        {{record.createTime | momentFormat:'YYYY-MM-DD HH:mm:ss'}}
                                    </td>

                                </tr>
                            </ng-template>
                        </p-table>
                        <div class="primeng-paging-container">
                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                (onPageChange)="getTableList($event)"
                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">

                            </p-paginator>
                            <span class="total-records-count">
                                {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                            </span>
                        </div>
                    </div>
                </div>
                <div class="modal-footer" style="justify-content: center;">
                    <button (click)="save()" type="button" class="btn btn-primary" [disabled]="!drawForm.form.valid"
                        [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i>
                        <span>同步BOM</span></button>
                </div>
            </form>
        </div>
    </div>
</div>